function SaveFile(){
	
	var filename = $('#btnFile').val().replace(/C:\\fakepath\\/i, '');

	var file = $("#btnFile").val();
	
	if(file ==""){
		document.getElementById("modal_content").innerHTML = "กรุณาเลือกไฟล์";
		$('#warningModal').modal();
	}else{
		document.getElementById("modal_content_confirmSaveModal").innerHTML = "คุณต้องการอัพโหลดไฟล์ "+"<br>ชื่อไฟล์ : "+filename;
		$('#confirmSaveModal').modal();
	}
}

function addDataTable(){
	$('#success_message').addClass('hide');
	$('#error_message').addClass('hide');
	$('#confirmSaveModal').modal('hide');

	var formData = new FormData($("#UploadFileImage")[0]);
	
	
		$.ajax({
			  type : 'POST',
			  url : "CS21002Srvl",
			  data: formData,
			  dataType : "json",
			  async: false,
			  cache: false,
			  contentType: false,
			  processData: false,
			  success: function (data) {
				  
				  if(data.success!=""){
					  $('#success_message').html("<span class='fa-stack fa-lg'> <i class='fa fa-circle fa-stack-2x'></i> <i class='fa fa-check fa-stack-1x fa-inverse'></i> </span> "+data.success);
					  $('#success_message').removeClass('hide');
				  }else{
					  $('#error_message').html("<span class='fa-stack fa-lg'> <i class='fa fa-circle fa-stack-2x'></i> <i class='fa fa-times fa-stack-1x fa-inverse'></i> </span> "+data.error);
					  $('#error_message').removeClass('hide');
				  }
				  
				  document.getElementById('btnFile').value = "";
				  document.getElementById('file').value = "";
				  //location.reload();
			  },
		});
	 
	
}

